package com.c.controller.admin;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.c.result.SingleResult;
import com.c.service.admin.SQLRunnerService;

@Controller
@RequestMapping("/sqlrunner")
public class SQLRunnerController {

	@Autowired
	private SQLRunnerService service;

	@RequestMapping("/getsql")
	@ResponseBody
	public SingleResult<String> islogin(HttpServletRequest request, HttpServletResponse response, String sql) {
		System.out.println("GET ..." + sql);
		SingleResult<String> result = service.sqlrunner(sql);
		return result;
	}
}
